package org.springframework.samples.mvc.basic.business;

import java.util.List;

import org.springframework.samples.mvc.basic.model.Identifiable;
import org.springframework.security.access.prepost.PreAuthorize;

public interface BusinessService<T extends Identifiable> {

	void save(T object);

	T findById(Long id);

	List<T> findAll();

	List<T> findAll(String orderBy);

	List<T> findAll(int startIndex, int pageSize);
	
	List<T> findAll(int startIndex, int pageSize, T queryInfo);

	@PreAuthorize("hasRole('ROLE_DELETE')")
	void delete(Long id);

    int count();

}
